using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Functional
{
    public class Concatenations
    {
        public static List<T[]> UnConcatenate<T>(T[] inputs, int subVectorLength)
        {
            List<T[]> lOut = new List<T[]>();
            T[] subVector;
            Int32 L1, L2, L3;
            L3 = 0;
            for (L1 = 0; L1 < inputs.Length / subVectorLength; L1++)
            {
                subVector = new T[subVectorLength];
                for (L2 = 0; L2 < subVectorLength; L2++)
                {
                    subVector[L2] = inputs[L3];
                    L3++;
                }
                lOut[L1] = subVector;
            }
            return lOut;
        }
    }
}